using System;
using System.Diagnostics;
using UnityEditor;

public class Proto2CSEditor: EditorWindow
{
    [MenuItem("Tools/Hyu/Proto2CS")]
    public static void Proto2CS()
    {
        //计时
        DateTime beginTime= DateTime.Now;
        
        Process proc = new Process();
        proc.StartInfo.WorkingDirectory = @"..\Proto\";
        proc.StartInfo.FileName = "unityRun.bat";

        proc.Start();
        proc.WaitForExit();
        AssetDatabase.Refresh();
        
        var time= DateTime.Now-beginTime;
        UnityEngine.Debug.Log("完成将proto文件转为CS文件，用时："+time.TotalMilliseconds+"ms");
    }
}
